Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: PR #47523: fix(tui): roll over compact counts to M at 999,950 This is the exact same fix addressing the same issue—rolling over compact number formatting to display "M" at the 999,950 threshold instead of showing "1000.0K". Since PR #47523 already exists with identical scope and solution, PR #48969 appears to be a duplicate. |
|
Same as above — the body links |
|
Confirming the flag: #47523 is mine and is the same fix targeting |
Issue for this PR
Closes #33947
Type of change
What does this PR do?
Locale.number()formats the thousands value withtoFixed(1), so any count from 999,950 to 999,999 rounds to1000.0and renders as1000.0K. The>= 1000000branch never gets a chance to promote it, because the count itself is still under a million. It shows up in the TUI context indicator on ~1M token context models, e.g.1000.0K (100%).Rolling over at 999,950 — the point where one-decimal rounding first reaches
1000.0K— makes those values render as1.0M. Nothing below that boundary changes.How did you verify your code works?
Added a case to
packages/tui/test/util/locale.test.ts: 999,949 still formats as999.9K, 999,950 and 999,999 now format as1.0M, plus the plain/K/M cases so the fix can't regress them. 3/3 pass in that file.No screenshot — reproducing it in the UI needs a session grown to ~999,950 tokens, so the boundary is covered by the unit test instead.
Checklist